cmake_minimum_required(VERSION 3.4.1)

add_definitions(-DLUA_USE_DLOPEN -DLUA_USE_C89 -DLUA_COMPAT_5_1 -DLUA_COMPAT_5_2)

include_directories(../lua/lua)
include_directories(../lua/tolua)
include_directories(../lua/cjson)
include_directories(../lua)
include_directories(.)
include_directories(common luaext)
include_directories(../external/openssl/include)
include_directories(../external/xxtea)
include_directories(../external/unzip)
include_directories(../external/zlib/include)

aux_source_directory(. SRC_LIST)
aux_source_directory(./common SRC_LIST)
aux_source_directory(./luaext SRC_LIST)
aux_source_directory(./luaext/color3b SRC_LIST)
aux_source_directory(./luaext/color3f SRC_LIST)
aux_source_directory(./luaext/common SRC_LIST)
aux_source_directory(./luaext/image SRC_LIST)
aux_source_directory(./luaext/point SRC_LIST)
aux_source_directory(./luaext/rect SRC_LIST)
aux_source_directory(./luaext/runtime SRC_LIST)
aux_source_directory(./luaext/screen SRC_LIST)
aux_source_directory(./luaext/script SRC_LIST)
aux_source_directory(./luaext/size SRC_LIST)
aux_source_directory(./luaext/storage SRC_LIST)
aux_source_directory(./luaext/task SRC_LIST)
aux_source_directory(./luaext/touch SRC_LIST)
aux_source_directory(./luaext/ui SRC_LIST)
aux_source_directory(./luaext/utils SRC_LIST)
aux_source_directory(./luaext/xmod SRC_LIST)

aux_source_directory(../external/xxtea SRC_LIST)

add_library(luajava SHARED ${SRC_LIST})

target_link_libraries(luajava jnigraphics log lua tolua cjson luasocket luasec unzip)